/**
	Article 1 Code Sample
	Basic Shape with GLUT and OpenGL
	
	
*/

#include <GL/glut.h>

void init()
{
glClearColor(1.0,1.0,1.0,0.0);	
glColor3f(0.0,0.0,0.0);		
	
glMatrixMode(GL_PROJECTION); 
				
glLoadIdentity();			
glOrtho(0.0,1.0,0.0,1.0,-1.0,1.0);	
}


void drawSquare()
{
glClear(GL_COLOR_BUFFER_BIT);	
glBegin(GL_POLYGON);		
    glVertex3f(0.25,0.25,0.0);
    glVertex3f(0.25,0.75,0.0);	
    glVertex3f(0.75,0.75,0.0);
    glVertex3f(0.75,0.25,0.0);
glEnd();			
glFlush();	
}


int main( int argc, char *argv[] )
{
glutInit( &argc, argv );			
glutInitDisplayMode(GLUT_RGB);			
glutInitWindowSize(500,500);		
glutInitWindowPosition(200,100);		
glutCreateWindow("Hello world app");		
init();
glutDisplayFunc(drawSquare);		

glutMainLoop();					
						
return 0;
}

/**
	Author: seb
	Email: sebthestampede@gmail.com
	Home: http://seb.tnb.pl/
	
	If you want to use some of the code in your programs, please add this comment to your file.
*/

